﻿@{
    ViewBag.Title = "Prueba";
    var cad = "gg";
}

<h2>Prueba</h2>
<div>@ViewBag.id</div>

<p>
    <button  onclick="mod()">modificar</button>
    <script type="text/javascript">
        function mod() {

            $('#valor').val('@cad');
            $('#valor').attr("disabled", true);
        }
    </script> 
</p>